﻿using Castle.Windsor;
using DumpsterDoggy.Domain;
using DumpsterDoggy.Domain.Address;
using DumpsterDoggy.Domain.Orders;

namespace Console
{
    public class Program
    {
        private static void Main()
        {
            var container = new WindsorContainer("windsor.config.xml");

            var order = container.Resolve<IOrder>();
            order.Address = new Address {Country = "USA", StateOrProvince = "KS"};
            order.AddProduct(new Product(499.99m, 1));
            order.AddProduct(new Product(199.95m, 2));

            System.Console.WriteLine("Order Total: {0}", order.SubTotal());
            System.Console.WriteLine("Lowest Fee: {0}", order.CalculateLowestShippingFee());
            System.Console.WriteLine("Highest Fee: {0}", order.CalculateHighestShippingFee());
            System.Console.WriteLine("=====================================================");

            order = container.Resolve<IOrder>();
            order.Address = new Address {Country = "USA", StateOrProvince = "KS"};
            order.AddProduct(new Product(499.99m, 1));
            order.AddProduct(new Product(199.95m, 2) {IsHazardous = true});

            System.Console.WriteLine("Order Total: {0}", order.SubTotal());
            System.Console.WriteLine("Lowest Fee: {0}", order.CalculateLowestShippingFee());
            System.Console.WriteLine("Highest Fee: {0}", order.CalculateHighestShippingFee());
            System.Console.WriteLine("=====================================================");

            order = container.Resolve<IOrder>();
            order.Address = new Address {Country = "USA", StateOrProvince = "KS"};
            order.AddProduct(new Product(499.99m, 1));
            order.AddProduct(new Product(199.95m, 2) {RequiresForkList = true});

            System.Console.WriteLine("Order Total: {0}", order.SubTotal());
            System.Console.WriteLine("Lowest Fee: {0}", order.CalculateLowestShippingFee());
            System.Console.WriteLine("Highest Fee: {0}", order.CalculateHighestShippingFee());
            System.Console.WriteLine("=====================================================");
        }
    }
}